document.addEventListener('DOMContentLoaded', function() {
    // 返回按钮逻辑
    const backButton = document.querySelector('.back-button');
    backButton.addEventListener('click', function() {
        window.history.back();
    });

    // 底部菜单栏高亮逻辑
    const currentPath = window.location.pathname;
    const navLinks = document.querySelectorAll('footer nav ul li a');
    navLinks.forEach(link => {
        if (link.getAttribute('href') === currentPath) {
            link.classList.add('active');
        }
    });

    // 更多菜单按钮点击逻辑
    const moreMenuButton = document.getElementById('more-menu-button');
    const moreMenuPanel = document.getElementById('more-menu-panel');
    moreMenuButton.addEventListener('click', function() {
        moreMenuPanel.classList.toggle('show');
    });

    // 点击页面其他地方关闭菜单面板
    document.addEventListener('click', function(event) {
        if (!moreMenuButton.contains(event.target) && !moreMenuPanel.contains(event.target)) {
            moreMenuPanel.classList.remove('show');
        }
    });
});
